Repository navigation
fix(domains): correct mutation response types - #317
Open
mayankbohradev wants to merge 2 commits into
Open
mayankbohradev wants to merge 2 commits into
mayankbohradev wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #317 +/- ##
===========================================
+ Coverage 82.66% 97.67% +15.00%
===========================================
Files 4 90 +86
Lines 75 5545 +5470
===========================================
+ Hits 62 5416 +5354
- Misses 13 129 +116 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Correct the return types of
Domains.update,Domains.verify, andDomains.remove, including their async variants.Why
The SDK types these responses as a full
Domain. A caller can readDomains.verify(id)["status"]without a type error, but the API response has nostatusand the lookup can raiseKeyError.How
Testing
tox -e lint,mypy,pypassed (862 tests).Notes for reviewers
This narrows the public type annotations. The request and response data are unchanged. Use
Domains.get()to read the current status.Summary by cubic
Corrects the return types of
Domains.update,Domains.verify, andDomains.remove(sync and async) to match the documented API response shapes. Previously these were typed as a fullDomain, so callers could read fields likestatusthat aren't in the response and hit aKeyError.UpdateDomainResponse,VerifyDomainResponse, andRemoveDomainResponsetypes with only the fields the API actually returns.assert_type.Domains.get()to read a domain's current status; the request and response payloads are unchanged.Written for commit 82886c4. Summary will update on new commits.